﻿<UserControl x:Class="Hardanger.View.ResultsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="800
             ">
    <Grid DataContext="{Binding ResultsVm}">
		<Border Margin="12" BorderBrush="Black"  BorderThickness="1">
		<ScrollViewer  VerticalScrollBarVisibility="Visible">

                <ListView  Name="ResultsListView" ItemsSource="{Binding Results}" SelectedValue="{Binding CurrentResult}">					
					<ListView.ItemContainerStyle>
						<Style TargetType="{x:Type ListViewItem}">
							<EventSetter Event="MouseDoubleClick" Handler="OnResultsListView_MouseDoubleClick" />							
						</Style>
					</ListView.ItemContainerStyle>
                    <ListView.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Show Details" Command="{Binding ShowDetailsCommand}" />
                            <MenuItem Header="Remove This Result" Command="{Binding RemoveCurrentResultCommand}" />
                            <MenuItem Header="Clear All Results" Command="{Binding ClearAllResultsCommand}" />
                        </ContextMenu>
                    </ListView.ContextMenu>
					<ListView.View>
						<GridView>
							<GridViewColumn Width="150" Header="Feature"  DisplayMemberBinding="{Binding Path=Feature}" />
							<GridViewColumn Width="150" Header="Severity"  DisplayMemberBinding="{Binding Path=Severity}" />
							<GridViewColumn Width="150" Header="CreatedDate"  DisplayMemberBinding="{Binding Path=CreatedDate}" />
							<GridViewColumn Width="Auto" Header="Description"  DisplayMemberBinding="{Binding Path=Description}" />
						</GridView>
					</ListView.View>
				</ListView>
			
		</ScrollViewer>
		</Border>

	</Grid>
</UserControl>
